<h2>xmla.js</h2>
<p>XML for Analysis methods.</p>
<hr/>

<h3>Functions</h3>
<ul>
	<li><a href="#discover">OAT.Xmla.discover(callback)</a></li>
	<li><a href="#dbschema">OAT.Xmla.dbschema(callback)</a></li>
	<li><a href="#tables">OAT.Xmla.tables(catalog, callback)</a></li>
	<li><a href="#columns">OAT.Xmla.columns(catalog, schema, table, callback)</a></li>
	<li><a href="#execute">OAT.Xmla.execute(callback)</a></li>
	<li><a href="#qualifiers">OAT.Xmla.qualifiers(callback)</a></li>
	<li><a href="#primarykeys">OAT.Xmla.primaryKeys(catalog,schema,table,callback)</a></li>
	<li><a href="#foreignkeys">OAT.Xmla.foreignKeys(catalog,schema, table,callback)</a></li>
	<li><a href="#providertypes">OAT.Xmla.providerTypes(callback)</a></li>
</ul>


<h3>Properties</h3>
<ul>
	<li>OAT.Xmla.connection</li>
	<li>OAT.Xmla.query</li>
</ul>

<hr/>

<h3><a name="discover">OAT.Xmla.discover(callback)</a></h3>
<p>Sends a 'discover datasources' request, processes response, then performs <em>callback</em>. 
<code>OAT.Xmla.connection</code> should be set before calling this function.</p>
<p class="code">
var callback = function(data); {<br/>
 alert(data); // array of DSNs<br/>
}<br/>
OAT.Xmla.discover(callback);
</p>

<h3><a name="dbschema">OAT.Xmla.dbschema(callback)</a></h3>
<p>Sends a 'dbschema_catalogs' request, processes response, then performs <em>callback</em>.
<code>OAT.Xmla.connection</code> should be set before calling this function.</p>
<p class="code">
var callback = function(data); {<br/>
 alert(data); // array of catalogs<br/>
}<br/>
OAT.Xmla.dbschema(callback);
</p>

<h3><a name="tables">OAT.Xmla.tables(catalog, callback)</a></h3>
<p>Sends a 'dbschema_tables' request with <em>catalog</em> restriction, processes response, then performs <em>callback</em>.
<code>OAT.Xmla.connection</code> should be set before calling this function.</p>
<p class="code">
var callback = function(data); {<br/>
 alert(data[0]); // array of table names<br/>
 alert(data[1]); // array of table schemas<br/>
}<br/>
OAT.Xmla.tables(callback);
</p>

<h3><a name="columns">OAT.Xmla.columns(catalog, schema, table, callback)</a></h3>
<p>Sends a 'dbschema_columns' request with <em>catalog</em>, <em>schema</em> and <em>table</em> restrictions, processes response, then performs <em>callback</em>.
<code>OAT.Xmla.connection</code> should be set before calling this function.</p>
<p class="code">
var callback = function(data); {<br/>
 // data is an array of objects <br/>
 alert(data[0].name); // name of first column<br/>
}<br/>
OAT.Xmla.columns(callback);
</p>

<h3><a name="execute">OAT.Xmla.execute(callback)</a></h3>
<p>Sends a query for execution. 
<code>OAT.Xmla.connection</code> should be set before calling this function.</p>
<p class="code">
var callback = function(data); {<br/>
 var header = data[0]; <br/>
 var data = data[1]; <br/>
 alert(header.length); // count of columns in result<br/>
 alert(data.length); // count of rows in result<br/>
}<br/>
OAT.Xmla.execute(callback);
</p>


<h3><a name="qualifiers">OAT.Xmla.qualifiers(callback)</a></h3>
<p>Discovers qualifiers.</p>
<p class="code">
var callback = function(data); {<br/>
	alert("First qualifier "+data[0]);<br/>
	alert("Second qualifier "+data[1]);<br/>
}<br/>
OAT.Xmla.qualifiers(callback);
</p>


<h3><a name="primarykeys">OAT.Xmla.primaryKeys(catalog,schema,table,callback)</a></h3>
<p>Gets primary keys for this table.</p>
<p class="code">
var callback = function(data); {<br/>
 // data == array of column names<br/>
 alert(data);<br/>
}<br/>
OAT.Xmla.primaryKeys(catalog,schema,table,callback);
</p>

<h3><a name="foreignkeys">OAT.Xmla.foreignKeys(catalog,schema, table,callback)</a></h3>
<p>Gets all columns being a part of foreign key using this table.</p>
<p class="code">
var callback = function(data); {<br/>
 // data == array of objects<br/>
 for (var i=0;i&lt;data.length;i++) {<br/>
	alert(data[i][0].column+" "+data[i][1].column);<br/>
 }<br/>
}<br/>
OAT.Xmla.foreignKeys(catalog,schema,table,callback);
</p>

<h3><a name="providertypes">OAT.Xmla.providerTypes(callback)</a></h3>
<p>Discovers available datatypes.</p>
<p>Gets all columns being a part of foreign key using this table.</p>
<p class="code">
var callback = function(data); {<br/>
 // data == array of objects<br/>
 for (var i=0;i&lt;data.length;i++) {<br/>
	alert(data[i].name+" "+data[i].type);<br/>
 }<br/>
}<br/>
OAT.Xmla.providerTypes(catalog,schema,table,callback);
</p>
